//
//  StrategyCollectionViewCell.m
//  project
//
//  Created by lanou on 15/10/26.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "StrategyCollectionViewCell.h"
#import <UIImageView+WebCache.h>

@implementation StrategyCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        //图片
        _strategyImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, (kWidth - 110) / 4, (kWidth - 110) / 4)];
        _strategyImage.layer.masksToBounds = YES;
        _strategyImage.layer.cornerRadius = (kWidth - 110) / 8;
//        _strategyImage.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:_strategyImage];
        
        //文字
        _strategyLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, (kWidth - 110) / 4 + 5, (kWidth - 110) / 4, 20)];
//        _strategyLabel.backgroundColor = [UIColor yellowColor];
        _strategyLabel.font = [UIFont systemFontOfSize:12];
        _strategyLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_strategyLabel];
        
        self.contentView.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

-(void)setModel:(CatogryStrategyItemsModel *)model
{
    _model = model;
    [_strategyImage sd_setImageWithURL:[NSURL URLWithString:model.icon_url]];
    _strategyLabel.text = model.name;
}


@end
